package com.lrkj.back.controller;

import com.lrkj.back.service.CommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * Created by daiwe on 2018/5/11.
 */
@Controller
@RequestMapping("/ceshi")

public class TestController extends BaseController {
    @Autowired
    private  CommodityService commodityService;
    @RequestMapping("/login")
    @ResponseBody
    public ModelAndView findall(HttpServletRequest request, HttpServletResponse response){
        List findall = commodityService.findall();
        request.setAttribute("list",findall);
        System.out.print(findall);
        return new ModelAndView("/test/test")
 ;
    }
}
